package risk.control.project.poi.branch;


import com.alibaba.excel.EasyExcel;
import com.alibaba.excel.write.style.column.SimpleColumnWidthStyleStrategy;

import java.util.ArrayList;
import java.util.List;

/**
 * 读取本地excel
 * <a href="https://easyexcel.opensource.alibaba.com/">...</a>
 */
public class Template01 {

    //生成模板
    public static void main(String[] args) {
        List<BranchData> data = new ArrayList<>();

        // 文件路径
        String fileName = "D:/branchTemplate.xlsx";

        EasyExcel.write(fileName, BranchData.class)//
                .registerWriteHandler(new SimpleColumnWidthStyleStrategy(50)) // 设置列宽
                .sheet("Sheet1")//
                .doWrite(data);
    }


}
